#!/usr/bin/env python
# encoding: utf-8
# @author: Lin Han
# @contact: voldemort22@126.com
# @file: deprecated_app.py
# @time: 2021/4/1 17:09
# @desc:
from utils.mongo_tools import retrieve_all_mongo_values
from views.crud import send_to_message_queue
from views.configs import *

# history_clamp = retrieve_mongo_all_values(
#     {},
#     database_name=MONGO_DATABASE_NAME,
#     collection_name=HISTORY_CLAMP_COLLECTION,
# )
#
# filter_history_clamp = []
# for i in history_clamp:
#     if i["file"]["transferFormatMessage"] != "success":
#         # print(i)
#         send_to_message_queue(i, queue="upload2oss")
#         filter_history_clamp.append(i)
standard_clamp = retrieve_all_mongo_values(
    {},
    database_name=MONGO_DATABASE_NAME,
    collection_name=STANDARD_CLAMP_COLLECTION,
)

filter_standard_clamp = []
for i in standard_clamp:
    if i["file"]["transferFormatMessage"] != "success":
        # print(i)
        send_to_message_queue(i, queue="upload2oss")
        filter_standard_clamp.append(i)
